<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<body>
    <script>
        //伪数组转数组的封装方法
        let lis=document.getElementsByTagName("li");
       function array(arr){
           let array1=Array.from(arr);
           return array1;
           console.log(array1);
       }
       array(lis);





        //数组的浅拷贝封装的方法
        let arr = [1, 2, 43, 5, 67, 87]
        function arr1(str){
            let arr1 =[...str];
            return arr1;
        }
         arr1(arr);



        //对象的浅拷贝封装的方法
        let obj4 = {
            name: "张三",
            age: 18,
            gender: "男",
            hobbies: ["吃", "喝", "玩"]
        }
        function fun(arr) {
            let obj5 = Object.assign({}, arr);
            return obj5
            console.log(obj5);
        }
        fun(obj4);

    </script>
</body>

</html>